package com.xxonehjh.demo.spring.transaction.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;


@Component
public class MyTransactionListener {

	private static final Log logger = LogFactory.getLog(OrderService.class);
	
	@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
	private void onCommit(MyAfterTransactionEvent event) {
		logger.info("【通过事件监听】事务状态：已提交 ; " + event);
	}
	
}